par(pty="s")
mapBG1 = plotmap("Brandenburg Gate, Berlin", zoom = 15)
mapBG2 = plotmap("Brandenburg Gate, Berlin", zoom = 16, maptype="satellite")
par(pty="s")
mapBG3 = GetBingMap(center="Brandenburg Gate, Berlin", zoom=12, extraURL="&mapLayer=TrafficFlow",
apiKey=apiKey,verbose=1, destfile="BerlinTraffic.png")
## geocoding Brandenburg Gate, Berlin
## fetching http://maps.google.com/maps/api/geocode/json?sensor=false&address=Brandenburg%20Gate,%20Berlin
## [1] "http://dev.virtualearth.net/REST/v1/Imagery/Map/Road/52.5162746,13.377704/12?mapSize=640,640&format=png&mapLayer=TrafficFlow&key=%20Ar6pkFx-XidvH9KD_2LEKf2fQpcssc3gMEiIxFQYQykF17MbqOZm31yA7Z5hxB27"
PlotOnStaticMap(mapBG3)
no highways:
par(pty="s")
ManHatMap <- GetMap(center="Lower Manhattan", zoom=15,
extraURL="&style=feature:road.highway|visibility:off")
PlotOnStaticMap(ManHatMap)
data(incidents)
col=as.numeric(incidents$Category)
par(pty="s")
mapSF_Z15 = plotmap(lat, lon, zoom = 15, col = col, pch=20, data = incidents)
#mapSF_Z13 = with(incidents, plotmap(lat, lon, zoom = 13, col = "Category", pch=20))
#lower zoom
mapSF_Z13 = RgoogleMaps::plotmap(lat, lon, zoom = 13, col = col, pch=20, data = incidents, alpha = 0.7)
It would be wasteful to have to fetch a new map from the map server for each new plot! Instead, we pass the map object to the next calls:
par(pty="s")
SundayCrimes = subset(incidents, DayOfWeek=="Sunday")
col=as.numeric(SundayCrimes$violent)
plotmap(lat, lon, mapSF_Z13, col = col, pch=20, data = SundayCrimes, alpha = 0.5)